
declare module Microsoft.Office.WebExtension {

    /** Represents custom settings for a task pane or content app that are stored in the host document as name/value pairs. */
    export class Settings {

        /** Adds an event handler for the settingsChanged event. */
        addHandlerAsync(eventType: Microsoft.Office.WebExtension.EventType, handler: any, options?: { asyncContext?: any; }, callback?: (result: AsyncResult) => void): void;

        /** Retrieves the specified setting. */
        get(name: string): any;

        /** Reads all settings persisted in the document and refreshes the content or task pane app's copy of those settings held in memory. */
        refreshAsync(callback?: (result: AsyncResult) => void);

        /** Removes the specified setting. */
        remove(name: string);

        /** Removes an event handler for the settingsChanged event. */
        removeHandlerAsync(eventType: Microsoft.Office.WebExtension.EventType, handler: any, options?: { handler?: string; asyncContext?: any; }, callback?: (result: AsyncResult) => void): void;

        /** Persists the in-memory copy of the settings property bag in the document. */
        saveAsync(callback?: (result: AsyncResult) => void);

        /** Sets or creates the specified setting. */
        set(name: string, value: string);
        }
}